﻿
/*******************************************************************************************
// ©2009 Microsoft Corporation.  This code is provided under the Microsoft Public License.
*******************************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Microsoft.Rtc.Collaboration;

namespace UCMACellularWS
{
    /// <summary>
    /// Configuration settings for the platform
    /// </summary>
    public class PubSubPlatformConfiguration
    {
        public string ApplicationUserAgent
        {
            get
            {
                return ConfigurationManager.AppSettings["applicationUserAgent"];
            }
        }

        public string OcsServerFqdn
        {
            get
            {
                return ConfigurationManager.AppSettings["ocsServerFqdn"];
            }
        }

        public int OcsServerTlsPort
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["ocsServerTlsPort"]);
            }
        }

        public string BotUri
        {
            get
            {
                return ConfigurationManager.AppSettings["botUri"];
            }
        }

        public string SmtpServer
        {
            get
            {
                return ConfigurationManager.AppSettings["smtpServer"];
            }
        }

        public int SmtpPort
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["smtpPort"]);
            }
        }

        public string liveAccountID
        {
            get
            {
                return ConfigurationManager.AppSettings["liveAccountID"];
            }
        }

        public string liveAccountPwd
        {
            get
            {
                return ConfigurationManager.AppSettings["liveAccountPassword"];
            }
        }

        public string clientIP
        {
            get
            {
                return ConfigurationManager.AppSettings["clientIP"];
            }
        }

        public int tokenDuration
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["tokenDuration"]);
            }
        }

        public string GreetMessage
        {
            get
            {
                return ConfigurationManager.AppSettings["greetMessage"];
            }
        }

        public string Reply
        {
            get
            {
                return ConfigurationManager.AppSettings["reply"];
            }
        }

        public string EmailSubject
        {
            get
            {
                return ConfigurationManager.AppSettings["emailSubject"];
            }
        }

        public List<TargetUserConfiguration> TargetUsers { get; set; }
    }

    /// <summary>
    /// Configuration settings for each Target user in config file
    /// </summary>
    public class TargetUserConfiguration
    {
        public UserEndpoint EndPoint { get; set; }
        public string Uri { get; set; }
        public bool IsAway { get; set; }
        public string SMSAddress { get; set; }

        public override bool Equals(object obj)
        {
            string uri = obj.ToString();
            if(this.Uri.Trim().ToLower().Equals(uri.Trim().ToLower()))
                return true;
            else
                return false;
             
        }
    }
}
